OPTIMIZATION=-o2 -march=native -msse -msse2 -msse3 -msse4a -m3dnow -mmmx

DIRS_INCLUDE=-Iinclude
DIRS_LIB=-Llib/static
#DIRS_LIB=-Iinclude -Llib/dynamic

#LIBS_BOOST=-lboost_date_time -lboost_filesystem -lboost_log  -lboost_regex -lboost_thread -lboost_system
LIBS_BOOST=-lboost_thread
LIBS_MISC=-lpthread
MISC_OPTIONS=

DEBUG_OPTIONS=-g

obj/Release/integral.o: src/integral.cpp src/integral.hpp src/config.hpp src/monitor.hpp
	g++  -c $(MISC_OPTIONS) -Wall $(DIRS_INCLUDE) $(OPTIMIZATION) src/integral.cpp -o  obj/Release/integral.o

obj/Release/main.o: src/main.cpp src/config.hpp src/monitor.hpp
	g++  -c $(MISC_OPTIONS) -Wall $(DIRS_INCLUDE) $(OPTIMIZATION)  src/main.cpp     -o obj/Release/main.o

Release: obj/Release/integral.o obj/Release/main.o
	g++     $(MISC_OPTIONS)       $(DIRS_LIB)     $(OPTIMIZATION) obj/Release/*.o   -o  bin/Release/integral  $(LIBS_BOOST) $(LIBS_MISC)


obj/Debug/integral.o: src/integral.cpp src/integral.hpp src/config.hpp src/monitor.hpp
	g++  -c $(MISC_OPTIONS) $(DEBUG_OPTIONS) -Wall $(DIRS_INCLUDE)  src/integral.cpp -o  obj/Debug/integral.o

obj/Debug/main.o: src/main.cpp src/config.hpp src/monitor.hpp
	g++  -c $(MISC_OPTIONS) $(DEBUG_OPTIONS) -Wall $(DIRS_INCLUDE)   src/main.cpp     -o obj/Debug/main.o

Debug: obj/Debug/integral.o obj/Debug/main.o
	g++     $(MISC_OPTIONS) $(DEBUG_OPTIONS)  $(DIRS_LIB)      obj/Debug/*.o   -o  bin/Debug/integral  $(LIBS_BOOST) $(LIBS_MISC)


Clean:
	rm -rf bin/Release/*
	rm -rf obj/Release/*
	rm -rf bin/Debug/*
	rm -rf obj/Debug/*

